Repository navigation
fix: short writes, lock gates, and interrupted /proc scans - #3
Merged
Merged
Conversation
This was referenced Nov 16, 2026
fgetxattr was not retried on EINTR, so a signal refused the replacement. atomicWrite also leaked the temporary path, the step names and the spare ACL read. Tests cover both under std.testing.allocator.
copyTo renames the new bytes into place, so a full disk or a file-size limit leaves an existing file unchanged. appendLine rolls a short write back to the size before it, so the line list does not gain a partial line.
lockExclusive reads its deadline from the monotonic clock, so a signal that cuts a sleep short does not expire the wait. RootLock refuses a gate or sidecar that is not a regular file of this user with one link.
decodeCache and key comparison read past a string that ended on a backslash. They now return an encoding error, and the bytes allocated before that error are freed.
The list was abandoned on the error path, and the slice it returned was not the whole allocation, so a caller could not free it.
The archive is written under a temporary name, synced and renamed. A crash or a short write no longer leaves a partial name.gz that a later run skips.
groupAlive treated EINTR from getdents as "nobody is alive", so waitGroupGone could return while the group was still running.
COMPAT.md said errno 134 was the unnamed hardware-error text. On x86_64 that text is errno 133, HWPOISON, which Zig names; 134 is unnamed, as glibc prints it. The module summary matches the copy and the lock gate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Short writes, lock gates, interrupted scans, and a few related error paths are tightened, and
COMPAT.mdnames errno 133 as the hardware-error text.fgetxattrwas not retried onEINTR, so a signal refused the replacement.atomicWritealso leaked the temporary path, the step names, and the spare ACL read. The ACL read is retried, and the scratch is freed.copyTotruncated the destination before the write finished, so a full disk or a file-size limit destroyed an existing file.appendLinecould leave a partial line.copyTonow renames new bytes into place, andappendLinerolls a short write back to the size before it.lockExclusivecould treat a signal that cut a sleep short as a timeout.RootLockaccepted a gate or sidecar that was not a regular file of this user with one link. The deadline is read from the monotonic clock, and a foreign gate is refused.decodeCacheand key comparison read past a string that ended on a backslash. They now return an encoding error and free the bytes allocated before that error.pySplitabandoned its list when allocation failed, and the slice it returned was not the whole allocation, so a caller could not free it. The list is freed on the error path.name.gzthat a later run skipped. The archive is written under a temporary name and renamed after it is synced.groupAlivetreatedEINTRfromgetdentsas "nobody is alive", sowaitGroupGonecould return while the group was still running. A signal during the scan is not an empty group.COMPAT.mdsaid errno 134 was the unnamed hardware-error text. On x86_64 that text is errno 133,HWPOISON, which Zig names; 134 is unnamed, as glibc prints it. The module summary matches the copy and the lock gate.The atomic-write commit says its tests use
std.testing.allocator. The docs commit checks thatdescribeprints[Errno 133] Memory page has hardware errorand[Errno 134] Unknown error 134, and thatCOMPAT.mdnames errno 133. Each of the fix and docs commits has a towncrier fragment, and the branch addstowncrier.toml.